package kr.pe.johnkim.chattingday.mobile.rest.service;

import kr.pe.johnkim.chattingday.mobile.domain.ChattingDayGatheringMessageWarning;
import kr.pe.johnkim.chattingday.mobile.rest.dao.ChattingDayGatheringMessageWarningDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Chatting Day 채팅방 메시지 신고/처리를 위한 서비스 메소드들을 구현한 클래스 이다.
 * 
 * @author : johnkim <cale9797@gmail.com / Bettersoft Inc,.>
 * @Date : 12. 6. 12
 */
public class ChattingDayGatheringMessageWarningServiceImpl implements ChattingDayGatheringMessageWarningService {
    // SLF4J Logging
    private Logger logger = LoggerFactory.getLogger(ChattingDayGatheringMessageWarningServiceImpl.class);

    @Autowired
    private ChattingDayGatheringMessageWarningDao chattingDayGatheringMessageWarningDao = null;

    /**
     * 채팅방 불량 메시지에 경고를 추가 한다.
     *
     * @return
     */
    @Override
    public boolean registerGatheringWarning(ChattingDayGatheringMessageWarning chattingDayGatheringMessageWarning) {
        logger.info("registerGatheringWarning");

        return chattingDayGatheringMessageWarningDao.registerGatheringWarning(chattingDayGatheringMessageWarning);
    }

    /**
     * 채팅방 불량 메시지에 경고 추가한 것을 취소 한다.
     *
     * @param chattingDayGatheringMessageWarning
     *
     * @return
     */
    @Override
    public boolean updateDeactivateGatheringMessageWarning(ChattingDayGatheringMessageWarning chattingDayGatheringMessageWarning) {
        logger.info("updateDeactivateGatheringMessageWarning");

        return chattingDayGatheringMessageWarningDao.updateDeactivateGatheringMessageWarning(chattingDayGatheringMessageWarning);
    }

    /**
     * 채팅방 해당 불량 메시지의 신고 총 건수를 가져 온다.
     *
     * @param chattingDayGatheringMessageWarning
     *
     * @return
     */
    @Override
    public ChattingDayGatheringMessageWarning selectGatheringMessageWarningCount(ChattingDayGatheringMessageWarning chattingDayGatheringMessageWarning) {
        logger.info("selectGatheringMessageWarningCount");
        
        return chattingDayGatheringMessageWarningDao.selectGatheringMessageWarningCount(chattingDayGatheringMessageWarning);
    }
}
